package vin.pth.authentication.handler;

import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import reactor.core.publisher.Mono;
import vin.pth.base.exception.authentication.AuthenticationException;

/**
 * @author Cocoon
 */
public interface AuthenticationHandler {

  /**
   * 权限校验不通过的处理.
   *
   * @param request  HttpServletRequest
   * @param response HttpServletResponse
   * @param e        AuthenticationException 鉴权异常
   * @return Mono<Void>
   */
  Mono<Void> failureHandler(ServerHttpRequest request, ServerHttpResponse response,
      AuthenticationException e);

}